<!DOCTYPE html>
<html lang="en" xmlns:v-on="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="app">
    <input type="text" v-model="num1">
    +
    <input type="text" v-model="num2">
    =
    <span v-text="result"></span>
    <button v-on:click="change">计算</button>
</div>

<script src="vue.min.js"></script>
<script>
    // 编写MVVM中的mode部分以及VM（ViewModel）部分
    let VM = new Vue({
        el: "#app", // vm接管了app区域的管理
        data: { // model数据
            num1: '',
            num2: '',
            result: ''
        },
        methods: {
            change: function () {
                this.result = Number.parseInt(this.num1) +Number.parseInt(this.num2);
            }
        }
    });
</script>
</body>
</html>